package com.service.impl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.FavoriteMapper;
import com.entity.Cart;
import com.entity.Favorite;
import com.pojo.Favorites;
import com.service.FavoriteService;

import java.util.List;

/**
 * @program: ssm
 * @description: 收藏
 * @author: zl
 * @create: 2022-05-17 21:37
 **/

@Service("favorite")
public class FavoriteServiceImpl implements FavoriteService{

    @Autowired
    private FavoriteMapper favoriteMapper;

    public void setFavoriteMapper(FavoriteMapper favoriteMapper){
        this.favoriteMapper=favoriteMapper;
    }

    public List<Favorites> selectALl(@Param("user_id") int user_id) {
        return favoriteMapper.selectALl(user_id);
    }

    public int deleteFavorite(int fid) {
        return favoriteMapper.deleteFavorite(fid);
    }

    public int addFavorite(Favorite cart) {
        return favoriteMapper.addFavorite(cart);
    }

	
}
